bitkeeper revision 1.83 (3e5636c8h7gxJ2TkjvrnmiqkZh15Bg)
authorkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Fri, 21 Feb 2003 14:25:12 +0000 (14:25 +0000)
committerkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>
Fri, 21 Feb 2003 14:25:12 +0000 (14:25 +0000)
cpufeature.h, kernel.c, setup.c, mpparse.c:
  Hyperthreading support. We now parse ACPI tables at start of day. Both can be disabled with 'noht' and 'noacpi' cmdline options.

xen-2.4.16/arch/i386/mpparse.c
xen-2.4.16/arch/i386/setup.c
xen-2.4.16/common/kernel.c
xen-2.4.16/include/asm-i386/cpufeature.h

index 4f0edeea0e8d3bdd668150c4e158befe9cade2c0..0e2ca870a9b0a8b5dcb7f27fb8732a1cef3189f9 100644 (file)
@@ -781,7 +781,7 @@ void __init get_smp_config (void)
         * processor(s) that are provided by the MPS. We attempt to 
         * check only if the user provided a commandline override
         */
-       //XXX Xen config_acpi_tables();
+        config_acpi_tables();
 #endif
        
        printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
index b5618485ecee86405d1e85b3daad7a2a087e0670..f4f62c2b02ecb27644dfcc1050182741213b5fdc 100644 (file)
@@ -103,6 +103,7 @@ static void __init init_amd(struct cpuinfo_x86 *c)
  */
 void __init identify_cpu(struct cpuinfo_x86 *c)
 {
+    extern int opt_noht, opt_noacpi;
     int junk, i;
     u32 xlvl, tfms;
 
@@ -163,6 +164,12 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
         panic("Only support Intel processors (P6+)\n");
     }
        
+    if ( opt_noht )
+    {
+        opt_noacpi = 1; /* Virtual CPUs only appear in ACPI tables. */
+        clear_bit(X86_FEATURE_HT, &c->x86_capability[0]);
+    }
+
     printk("CPU caps: %08x %08x %08x %08x\n",
            c->x86_capability[0],
            c->x86_capability[1],
index 5b7ec546bf3cd72a87d624da99afa731d702738c..09aae6fc7076fbae2ac24a829246408eb62a13cb 100644 (file)
@@ -45,7 +45,8 @@ unsigned long opt_dom0_ip = 0;
 unsigned int opt_dom0_mem = 16000; /* default kbytes for DOM0 */
 unsigned int opt_ne_base = 0; /* NE2k NICs cannot be probed */
 unsigned char opt_ifname[10] = "eth0";
-enum { OPT_IP, OPT_STR, OPT_UINT };
+int opt_noht=0, opt_noacpi=0;
+enum { OPT_IP, OPT_STR, OPT_UINT, OPT_BOOL };
 static struct {
     unsigned char *name;
     int type;
@@ -55,6 +56,8 @@ static struct {
     { "dom0_mem", OPT_UINT, &opt_dom0_mem }, 
     { "ne_base",  OPT_UINT, &opt_ne_base },
     { "ifname",   OPT_STR,  &opt_ifname },
+    { "noht",     OPT_BOOL, &opt_noht },
+    { "noacpi",   OPT_BOOL, &opt_noacpi },
     { NULL,       0,        NULL     }
 };
 
@@ -125,27 +128,31 @@ void cmain (unsigned long magic, multiboot_info_t *mbi)
         while ( cmdline != NULL )
         {
             while ( *cmdline == ' ' ) cmdline++;
-            if ( (opt = strchr(cmdline, '=')) == NULL ) break;
-            *opt++ = '\0';
-            opt_end = strchr(opt, ' ');
+            if ( *cmdline == '\0' ) break;
+            opt_end = strchr(cmdline, ' ');
             if ( opt_end != NULL ) *opt_end++ = '\0';
+            opt = strchr(cmdline, '=');
+            if ( opt != NULL ) *opt++ = '\0';
             for ( i = 0; opts[i].name != NULL; i++ )
             {
-                if ( strcmp(opts[i].name, cmdline ) == 0 )
+                if ( strcmp(opts[i].name, cmdline ) != 0 ) continue;
+                switch ( opts[i].type )
                 {
-                    if ( opts[i].type == OPT_IP )
-                    {
+                case OPT_IP:
+                    if ( opt != NULL )
                         *(unsigned long *)opts[i].var = str_to_quad(opt);
-                    }
-                    else if(opts[i].type == OPT_STR)
-                    {
+                    break;
+                case OPT_STR:
+                    if ( opt != NULL )
                         strcpy(opts[i].var, opt);
-                    }
-                    else /* opts[i].type == OPT_UINT */
-                    {
+                    break;
+                case OPT_UINT:
+                    if ( opt != NULL )
                         *(unsigned int *)opts[i].var =
                             simple_strtol(opt, (char **)&opt, 0);
-                    }
+                    break;
+                case OPT_BOOL:
+                    *(int *)opts[i].var = 1;
                     break;
                 }
             }
index 598edbdafebe5314d9e8d6ea3912ccec8994f3e7..85b8b43974de0ba180214b72bdc214c0052cd418 100644 (file)
@@ -40,6 +40,7 @@
 #define X86_FEATURE_XMM                (0*32+25) /* Streaming SIMD Extensions */
 #define X86_FEATURE_XMM2       (0*32+26) /* Streaming SIMD Extensions-2 */
 #define X86_FEATURE_SELFSNOOP  (0*32+27) /* CPU self snoop */
+#define X86_FEATURE_HT         (0*32+28) /* Hyper-Threading */
 #define X86_FEATURE_ACC                (0*32+29) /* Automatic clock control */
 #define X86_FEATURE_IA64       (0*32+30) /* IA-64 processor */
 
@@ -63,6 +64,8 @@
 #define X86_FEATURE_CYRIX_ARR  (3*32+ 2) /* Cyrix ARRs (= MTRRs) */
 #define X86_FEATURE_CENTAUR_MCR        (3*32+ 3) /* Centaur MCRs (= MTRRs) */
 
+#define cpu_has(c, bit)                test_bit(bit, (c)->x86_capability)
+
 #endif /* __ASM_I386_CPUFEATURE_H */
 
 /*